Skip to content

[19.0][MIG] hr_expense_cancel: Migration to 19.0 - #356

Open
dnplkndll wants to merge 25 commits into
OCA:19.0from
ledoent:19.0-mig-hr_expense_cancel
Open

[19.0][MIG] hr_expense_cancel: Migration to 19.0#356
dnplkndll wants to merge 25 commits into
OCA:19.0from
ledoent:19.0-mig-hr_expense_cancel

Conversation

@dnplkndll

@dnplkndll dnplkndll commented May 27, 2026

Copy link
Copy Markdown

Port of hr_expense_cancel from 18.0 to 19.0 (migration guide).

Non-mechanical adaptations worth flagging

  • Hook target changed from hr.expense.sheet.action_cancel to hr.expense.action_reset() — core's action_reset refuses to reset an expense linked to a posted entry; the module tears down payments and the posted move first so the guard passes. Everything runs with the caller's rights, as in 18.0: payment teardown requires accounting ACL, and expenses without a move (the everyday employee reset) touch no accounting model.
  • No dependency on hr_expense_payment: payments are found via core's reconciled_payment_ids (reconciliation walk ∪ stored matched_payment_ids, so wizard payments whose reconciliation was removed are torn down too), and _remove_move_reconcile walks partials via _get_reconciled_amls() instead of full_reconcile_id.
  • Per-expense, not per-sheet: helpers operate on expense.account_move_id.
  • payment.state rename: 18.0 'cancel' → 19.0 'canceled'.

19.0 relevance

Core's action_reset reverses the expense's move but refuses when payments exist; payment-side teardown is this module's remaining value.

AI-assisted (Claude Code); every change reviewed, tested, and owned by the author.

@dnplkndll
dnplkndll force-pushed the 19.0-mig-hr_expense_cancel branch 4 times, most recently from 1b60db9 to 5472351 Compare May 29, 2026 20:09
@dnplkndll
dnplkndll force-pushed the 19.0-mig-hr_expense_cancel branch 4 times, most recently from d6ad906 to 62ef7a7 Compare June 19, 2026 19:12
@dnplkndll
dnplkndll force-pushed the 19.0-mig-hr_expense_cancel branch from 62ef7a7 to fa7af75 Compare June 22, 2026 18:28

@pilarvargas-tecnativa pilarvargas-tecnativa left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This migration still depends on hr_expense_payment and uses its custom hr.expense.payment_ids relation.

@dnplkndll

Copy link
Copy Markdown
Author

@pilarvargas-tecnativa updated to remove the hr_expense_payment dap and I think hr_expense_payment can be dropped

hr.expense.sheet was removed in 19.0; the reset flow moves to a
per-expense hr.expense.action_reset() override.

- action_reset() tears down linked payments (unreconcile + draft-cancel)
  and the posted move before super(), so core's reset guard passes.
  Everything runs with the caller's rights, as in 18.0: payment teardown
  keeps requiring accounting ACL, and expenses without a move (the
  everyday employee reset) touch no accounting model.
- The hr_expense_payment dependency is dropped: payments are found via
  core's reconciled_payment_ids (reconciliation walk union stored
  matched_payment_ids), and the unreconcile walks partials via
  _get_reconciled_amls() instead of full_reconcile_id.

Assisted-by: Claude Opus 5
@dnplkndll
dnplkndll force-pushed the 19.0-mig-hr_expense_cancel branch from 9272396 to 45a6ab4 Compare July 27, 2026 20:11
manuelcalerosolis added a commit to xtendoo-corporation/xtendoo that referenced this pull request Aug 26, 2026
OCA no mantiene estos 8 módulos que DJI usa en 19.0 (no existe rama 19.0
en sus repos), pero cada uno tiene un Pull Request abierto (sin fusionar)
que sí los migra. Decisión del usuario: usar esos PRs en vez de forkear
desde cero. Renombrados con prefijo xtendoo_ para evitar colisión de
nombre técnico si OCA fusiona el PR original más adelante.

- xtendoo_web_company_color <- OCA/web#3326 (HeliconiaIO/web)
- xtendoo_hr_expense_cancel <- OCA/hr-expense#356 (ledoent/hr-expense)
- xtendoo_hr_expense_payment <- OCA/hr-expense#355 (ledoent/hr-expense)
- xtendoo_website_whatsapp <- OCA/website#1207 (Jarsa-dev/website)
- xtendoo_stock_picking_mass_action <- OCA/stock-logistics-workflow#2161
  (adhoc-dev/stock-logistics-workflow)
- xtendoo_sale_report_margin <- OCA/margin-analysis#281 (ursais/margin-analysis)
- xtendoo_product_pricelist_direct_print <- OCA/product-attribute#2220
  (Studio73/product-attribute)
- xtendoo_account_move_line_stock_info <- OCA/stock-logistics-warehouse#2549
  (collinskipkorir/stock-logistics-warehouse) - version bump 18.0->19.0
  aplicado a mano, el PR original no lo traía

Además de renombrar directorio/manifest, corregidas referencias técnicas
reales que dependían del nombre del módulo (no solo cosméticas):
report_name/t-call/env.ref en product_pricelist_direct_print, ir.model.
access.csv + view id en stock_picking_mass_action, ruta de assets estáticos
en website_whatsapp (URL /website_whatsapp/static/... hubiera dado 404),
e imports de tests/__init__.py tras renombrar los ficheros de test.

3 módulos descontinuados (website_sale_product_description,
stock_picking_warn_message, account_payment_order_return) NO se implantan
en 19.0, decisión explícita del usuario.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:hr_expense_cancel Module hr_expense_cancel series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.